Skip to content

Application written in Go & React for allowing users to post interesting swim spots around Ireland

Notifications You must be signed in to change notification settings

RossoMaguire/swim-spots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swim Spots

Swim Spots is an application which allows users to post co-ordinates of awesome places they find around Ireland for a swim. Users can login to the app to share a spot, access all other users shared swim spots, favourite certain swim spots and find co-ordinates.

View a production build on Heroku : https://swim-spots.herokuapp.com/login

An example account login can be :

Username: rossmag17
Password: test

Built With

API and backend : Go 1.16.6.
Cloud DB : Postgres hosted with Heroku.
Frontend : React and TypeScript.

Getting Started -- follow these steps to run locally

Please ensure you have GO and Node installed on your machine

  1. Clone this repo and then cd swim spots. From there run go mod vendor to install dependencies.

  2. To install frontend dependencies cd frontend and from there run npm install or yarn.

  3. The DB connection reads from Environment variables for connecting to the database which is hosted on Heroku. Create a .env file in the base directory - refer to the report for the values you will need for these keys :

DBSERVER=
DBNAME=
DBUSER=
DBPASS=

Copy the values after the equals and save the .env file in the root of the project. The connection string in the app will read these and open the connection to the database.

a .env file that you can copy in will be provided with the submission on Moodle.

Start the project

To create a frontend app that can be served by the web server run :

yarn build

To open the connection to the db and to run the api & web server :

cd swim-spots
go run main.go

Visit the build on localhost:8090 to use the website.

An example account login can be :

Username: rossmag17
Password: test

logging in with a register account won't work as passwords are hashed on register, but not for the test accounts, and retreving a hash has not been included

Testing

To run tests

cd frontend
npm test FileName.test.js

Example : npm test CreateSpot.test.js

To make API requests via curl or Postman, refer to the endpoints in :

routes.go.

Development

To start the frontend in development :

cd frontend
yarn start

Whenever there are changes made to the backend or api (GO files) you need to restart the server :

cd swim-spots
go run main.go

About

Application written in Go & React for allowing users to post interesting swim spots around Ireland

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published