Update README.md
parent
ff7e87a5f9
commit
fa13b227d2
50
README.md
50
README.md
|
@ -1,17 +1,49 @@
|
|||
### Node Express template project
|
||||
# Score Tracker
|
||||
|
||||
This project is based on a GitLab [Project Template](https://docs.gitlab.com/ee/gitlab-basics/create-project.html).
|
||||
Main repository: https://gitlab.sudoer.ch/sudoer777/score-tracker/
|
||||
|
||||
Improvements can be proposed in the [original project](https://gitlab.com/gitlab-org/project-templates/express).
|
||||
A web app designed to collect and display scores for sports
|
||||
|
||||
### CI/CD with Auto DevOps
|
||||
## Branches
|
||||
|
||||
This template is compatible with [Auto DevOps](https://docs.gitlab.com/ee/topics/autodevops/).
|
||||
- [main](https://gitlab.sudoer.ch/sudoer777/score-tracker/-/tree/main) - Stable, production-ready code
|
||||
- [testing](https://gitlab.sudoer.ch/sudoer777/score-tracker/-/tree/testing) - Nearly complete code being tested
|
||||
- [develop](https://gitlab.sudoer.ch/sudoer777/score-tracker/-/tree/develop) - Unstable code under development
|
||||
|
||||
If Auto DevOps is not already enabled for this project, you can [turn it on](https://docs.gitlab.com/ee/topics/autodevops/#enabling-auto-devops) in the project settings.
|
||||
## Installation
|
||||
|
||||
### Developing with Gitpod
|
||||
This repository is designed to be pushed to Heroku/Dokku/etc.
|
||||
|
||||
This template has a fully-automated dev setup for [Gitpod](https://docs.gitlab.com/ee/integration/gitpod.html).
|
||||
### Requirements
|
||||
|
||||
If you open this project in Gitpod, you'll get all Node dependencies pre-installed and Express will open a web preview.
|
||||
- PostgreSQL (with empty database created and an account to access it)
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `NODE_ENV` - set to `production`, `testing`, or `development`
|
||||
- `PGHOST` - set to your database URL
|
||||
- `PGPORT` - set to the database port
|
||||
- `PGDATABASE` - set to the name of your database (i.e. `scoretrackerdb`)
|
||||
- `PGUSER` - set to the user for managing the database
|
||||
- `PGPASSWORD` - set to the password for that user
|
||||
|
||||
## Code
|
||||
|
||||
This program uses Node.js/Express.js for the backend, PostgreSQL for the database (with node-postgres), and Passport.js for managing users and sessions.
|
||||
|
||||
### Structure
|
||||
|
||||
- `database` folder contains backend scripts for managing and storing data.
|
||||
- `mail` folder (currenly unused) contains backend scripts for sending emails.
|
||||
- `public` folder contains publically accessible scripts and stylesheets for frontend.
|
||||
- `scripts` folder contains scripts used by specific webpages.
|
||||
- `stylesheets` folder contains CSS for various webpages.
|
||||
- `routes` folder contains various routes used by the program.
|
||||
- `about.js` directs to the about page (`/about`).
|
||||
- `auth.js` deals with logging in and out (`/auth/*`).
|
||||
- `checkLoginStatus.js` contains functions for checking the login status of the current user.
|
||||
- `data.js` sends various data to the client in JSON format (`/data/*`).
|
||||
- `index.js` directs to the home page (`/`).
|
||||
- `manage.js` contains various functions that allows the user to add and edit items through the web browser (`/manage/*`).
|
||||
- `views` folder contains pug templates for each webpage, and a `layout` template for the base layout of each page.
|
||||
- `.env.example` is a template for the environment variables in a development workspace. Rename to `.env` and change values as needed.
|
||||
|
|
Reference in New Issue