Skip to content

KVSRoyal/dragonfish

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dragonfish

Fire in its own way.

This is the backend repository for the Offprint fiction website.

It's still very much a work in progress.

Build Status

Dragonfish Build Test Production
Server Build Server (DO) Deploy Server (DO) Deploy to Production
Client Build Client (DO) Deploy Client (DO) Deploy to Production

Setting up the dev environment

You must have the following tools installed on your system or in a docker container (use listed versions or latest):

  • NodeJS 14.17.0
  • Yarn 1.22.10 (don't use 2.x)
  • MongoDB Community Server 4.2.1
    • MongoDB Compass is recommended
  • Redis server 6.2.6

For these, use the command yarn global add @angular/cli @nestjs/cli nx:

  • The Angular CLI 12.1.1 or higher (globally, via Yarn)
  • The NestJS CLI 8.0.1 or higher (globally, via Yarn)
  • The nx CLI (globally, via Yarn)

Building the application

Once you've installed and verified that these dependencies are working as expected...

  • Create a file named .env at the root of the repository
  • Copy the contents of sample.env to your new .env
  • Edit .env to set MONGO_URL=mongodb://localhost:27017
  • Edit .env to set your REDIS_* values
  • Edit .env to set JWT_SECRET to an actual secret, such as a plain random string
  • If you intend to test out image functionality, fill in the DIGITALOCEAN_SPACES variables with your information
  • If you intend to test out email functionality, fill in the appropriate SendGrid API information
  • Run yarn install in the repository root to install all the dependencies.

When you're starting the development server with nx serve client, make sure to include a .env file in the root project directory. A sample.env file can be found in the root of this repository.

VS Code is the recommended editor.

Running the application

Installing MongoDB should have resulted in a persistent MongoDB service running, which is necessary for the site.

Note that by default, the backend serves up the frontend, so in order to test the website, both of them must be running.

To run the backend:

nx serve api

To run the frontend:

nx serve bettafish

On some machines, the frontend won't automatically pick up changes and rebuild. In that case, you can try this:

nx build bettafish --watch --poll=2000

Then you should find the website at http://localhost:3333

Contributing

Check out the Contribution guides in the wiki!

TODO: Flesh this section out.

Deployment

For more information on deploying the server and client, and the project's infrastructure, take a look at deployment folder's readme.

Want to talk about the project?

Look no further. We have a Discord server!

About

The backend repository for the Offprint fiction website.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 67.6%
  • HTML 24.4%
  • SCSS 6.2%
  • JavaScript 1.5%
  • Other 0.3%