systemphil / symposia

Symposia is a philosophy course platform🏺
https://symposia.sphil.xyz
Apache License 2.0
6 stars 1 forks source link
course-platform nextjs philosophy systematic-philosophy typescript

🚧 This is a work in progress

If you'd like to be part of the development of this app, kindly follow the instructions below. If you have any further questions or would like to get involved, get in touch with Firgrep here.

Setting up your local environment and branch

0.0. Once you have access to the repo on github, fork and/or clone it into a folder where you keep your projects.

0.1. Then cd symposia to get into the project directory.

0.2. Make your own development branch git branch dev-<your-name> (example: git branch dev-tim).

0.3. Set the newly made development branch as the current active branch, run git checkout <your-branch-name>.

0.4. In future, when getting the latest changes from the main development branch, run git merge dev whilst on your development branch to incorporate the changes into your branch.

Packages Installation

1.0. Once inside, run npm i (alias npm install) to install all the packages. This will create the /node_modules folder.

Environmental Variables

2.0. After installation, run touch .env (or ni .env if you use Powershell or some windowsy thing).

2.1. Then, run cp env.example .env to copy the example env file.

2.2. Open the newly created .env file and check that it's populated. Ask Filip/Firgrep directly for the missing values.

Setting Up Local Prisma Client

3.0. Run npx prisma generate to generate the prisma client, this will be important for keeping your local types up to date with the database schema.

Running stripe local

4.0 stripe listen --forward-to 127.0.0.1:3000/api/stripe-webhook To enable local testing with webhook for stripe.

Running the Server

9.9. Finally, to start a local development server, run npm run dev and open up http://localhost:3000 on your favorite browser.

NextJS Client-Server Model

A high-level abstraction of the relationship between Client- and Server Components and how they interact with the backend. (Subject to change.)

nextjs-client-server-model

File Structure

/
├───logs
├───prisma
├───public
|   └───static
|
├───src
|   ├───app
|   |   ├───(admin)
|   |   ├───(user)
|   |   ├───api
|   |   |   ├───auth
|   |   |   └───trpc
|   |   |   error.tsx
|   |   |   favicon.ico
|   |   |   globals.css
|   |   |   page.tsx
|   |
|   ├───components
|   |
|   ├───config
|   |
|   ├───lib
|   |
|   ├───server
|   |   ├───api
|   |   |   ├───routers
|   |   |   |   routersRoot.ts
|   |   |   |   trpc.ts
|   |   |
|   |   ├───controllers
|   |   |   auth.ts
|   |   |   db.ts
|   |
|   └───utils
|
|   .env
|   .env.example

Explanation

Git Etiquette

Please review our guidelines concerning naming conventions for branches and commit messages in ./GIT-ETIQUETTE.md.