Skip to content

Latest commit

 

History

History
119 lines (96 loc) · 6.74 KB

getting-started.md

File metadata and controls

119 lines (96 loc) · 6.74 KB

Getting Started

Welcome to the getting started page! Here is all you need to know to get this repo up and running on your local machine, as well as good collaborative coding practices

Contents

Setup for all Developers

  1. Clone this repository git clone <repo-url>
  2. Run npm i at the root of the repository
  3. Create a .env file and retrieve secrets from your tech lead
  4. Install IDE Extensions
  5. Enable format on save in your IDE
    1. Click the settings button in the bottom left
      VSCode Settings 1
    2. Search "formatter" and set your default formatter to Prettier
    3. Search "format on save" and click the checkbox
  6. Familiarize yourself with Helpful Commands, the Project Structure, and the steps for contributing.

Helpful commands

  • npm run dev: Start your local development environment at http://localhost:3000
  • npm run lint: make sure Prettier and ESLint pass
  • npm run lint:fix: make sure Prettier and ESLint pass and try to automatically fix all issues (some ESLint issues must be resolved manually)
  • git stash: Temporarily remove all local changes to a branch and save them. Good when you need to hop to another branch without committing your current code.
  • git stash apply: Reapply most recent git stash.
  • git merge orgin/master: Pull all changes from the main branch to yours, good for resolving merge conflicts.

Project Structure

  • .github Github Actions CI/CD and Issue/PR templates
  • docs Documentation, including getting-started + contributing info.
  • public Assets for frontend Read More
  • src All application code
    • app Frontend and API code
      • api All API routes
      • admin Admin portal; all admin related pages
      • components All reusable components
      • images Site-wide images (admin and home pages)
      • /* App router routes for various pages
      • styles All CSS files
    • database MongoDB schemas and related files
    • helpers Mongoose connection
    • services Cookies + Sessions

This is a Next.js project bootstrapped with create-next-app.

Design

Link to Figma

Key Features

Admin

  • Create/Update/Delete New event for registered users to sign up for. (/src/app/admin/manage-events)
  • Create/Delete Blogs (appears in blog page). (/src/app/admin/blog) Note: For date, click the box in the calendar (you might need to select the box after today)
  • Create new resource to appear in resources page. (/src/app/admin/resources)
  • Manage members; view/edit an organized list of users, including contact information. (/src/app/admin/members)
  • Send emails by user type (volunteers, members, partners/donors, or individual). (/src/app/admin/email)
  • View donation history. (/src/app/admin/donations)
  • View event history, including signees + relevant information. (/src/app/admin/eventHistory)

User Authentication

  • Create account (/src/app/createAccount)
  • Login to account (/src/app/login)
  • Forgot password (/src/app//forgotPassword)
  • Reset password (/src/app/resetPassword)

Navigation & Other Features

  • Learn Go See's Story (src/app//about)
  • Donate to Go See Foundation (/src/app/donate)
  • View blog page- three most recent articles (/src/app/blog)
  • View blog archive - all older articles (/src/app/blog/archive)
  • View resources and supporters of Go See Foundation (/src/app/resources)
  • Sign up for an upcoming event (/src/app/eventSignup)

API Endpoints

  • /aws: Uploading files to Amazon S3 and storing the file URLs in a database
  • /blog: Create and Fetch Blogs.
  • /blog/[blogID]: Delete Blogs.
  • /donations: Fetching Donations.
  • /events: Exclusive admin priviledge; Create new event, Fetch events.
  • /events[eventName]: Exclusive admin priviledge; Fetch individual event, Delete Events.
  • /eventSignUp: Creates a new event signee in database with signup details.
  • /eventSignUp/[eventName]: Fetching individual event.
  • /forgot-password: Conditional depending on database info (ie, checks whether email exists).
  • /login: Authenticates user by verifying their email and password. If the credentials are correct, it generates a JSON Web Token (JWT) for the session, sets an HTTP-only cookie with the JWT, and responds with a success message.
  • /registration: Allows new users to register by providing their details. It validates the input, hashes the password for security, and stores the user information in the database. If any required fields are missing or if an error occurs, it returns an appropriate error message.
  • /resources: Creating new resource, fetching all resources.
  • /stripe: Handling stripe-related donation.
  • /user/[userID]: Exclusive admin priviledge; fetching and deleting an individual user.
  • /user: Exclusive admin priviledge; fetching all users (including fetching by user type).

Services Used

  • Next.js: We used Next.js to lessen the overhead of deploying a separate back-end. It provided tooling that would otherwise have been installed seperately (built-in routing, serverless functions, middleware, etc.)
  • MongoDB: MongoDB offers high performance, low-latency performance, and real-time analysis. It supports a flexible data model that can handle a variety of data formats, including structured and unstructured data.
  • AWS Services: S3 for image storage.

Learn More about Next.js

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!