Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FF site backend

The backend for the Final Frontier site. This server is responsible for serving the site's static files and handling the API requests. The server is built using Node.js and Express.js.

The backend uses a PostgreSQL database to store user data, such as user accounts and user-generated content such as characters, weapons, items, etc. We use the Prisma ORM to interact with the database.

Installation

  1. Clone this repository and run npm install.
  2. Create a .env file in the root directory. Fill in credentials as you see fit:
POSTGRES_USER=vortox
POSTGRES_PASSWORD=password
POSTGRES_DB=final-frontier

DATABASE_URL="postgresql://vortox:password@localhost:5432/final-frontier?schema=public"

PORT=3000
JWT_SECRET="change-me-in-production"
JWT_EXPIRATION=86400
SALT_ROUNDS=12
  1. Start the Postgres container (requires Docker):
sudo docker compose up -d
  1. Generate the Prisma client and apply the schema:
npx prisma generate
npx prisma migrate dev --name init
  1. (Optional) Seed the database with sample data:
npx prisma db seed
  1. Start the dev server:
npm run dev

The API is accessible at http://localhost:3000/api/. API docs are served at http://localhost:3000/api/docs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages