{"id":25733866,"url":"https://github.com/haydnmeyburgh/character-naming-contest","last_synced_at":"2026-06-18T05:32:16.925Z","repository":{"id":154500799,"uuid":"555233818","full_name":"HaydnMeyburgh/character-naming-contest","owner":"HaydnMeyburgh","description":"A REST API that allows users to post names to images and cast votes on names when authenticated and authorised","archived":false,"fork":false,"pushed_at":"2023-09-07T11:31:50.000Z","size":414,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T04:33:21.414Z","etag":null,"topics":["api","express","expressjs","javascript","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HaydnMeyburgh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-21T07:26:00.000Z","updated_at":"2023-09-07T08:02:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"ada38f52-c5c3-4973-82ae-5835dfc56218","html_url":"https://github.com/HaydnMeyburgh/character-naming-contest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HaydnMeyburgh/character-naming-contest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaydnMeyburgh%2Fcharacter-naming-contest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaydnMeyburgh%2Fcharacter-naming-contest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaydnMeyburgh%2Fcharacter-naming-contest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaydnMeyburgh%2Fcharacter-naming-contest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HaydnMeyburgh","download_url":"https://codeload.github.com/HaydnMeyburgh/character-naming-contest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaydnMeyburgh%2Fcharacter-naming-contest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34478105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","express","expressjs","javascript","nodejs","rest-api"],"created_at":"2025-02-26T04:30:55.475Z","updated_at":"2026-06-18T05:32:16.920Z","avatar_url":"https://github.com/HaydnMeyburgh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Character Naming Competition Backend\n\nWelcome to the Character Naming Competition Backend project! This repository contains the backend code for a character naming competition application. This README serves as documentation to help you understand, set up, and use the project effectively.\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n- [Usage](#usage)\n  - [API Endpoints](#api-endpoints)\n    - [Get All Character Images](#get-all-character-images)\n    - [Get Character Image by ID](#get-character-image-by-id)\n    - [Post Character Name](#post-character-name)\n    - [Update Character Name](#update-character-name)\n    - [Delete Character Name](#delete-character-name)\n    - [User Registration](#user-registration)\n    - [User Login](#user-login)\n    - [User Logout](#user-logout)\n    - [Update User Profile](#update-user-profile)\n    - [Cast a Vote](#cast-a-vote)\n    - [Remove a Vote](#remove-a-vote)\n  - [Authentication](#authentication)\n- [Database](#database)\n- [Documentation](#documentation)\n\n## Project Overview\n\nThe Character Naming Competition project handles user authentication, character image management, character name submissions, user voting, and more. This backend is built using Node.js, Express.js, and Sequelize ORM for managing the database.\n\n## Getting Started\n\n### Prerequisites\n\nTo run the Character Naming Competition Backend, you need the following:\n\n- Node.js and npm (Node Package Manager)\n- PostgreSQL database\n- Sequelize CLI (for database migrations)\n\n### Installation\n\n1. Clone this repository to your local machine:\n\n ```bash\n  git clone https://github.com/your-username/character-naming-backend.git\n``` \n\n2. Navigate to the project directory\n\n```bash\n  cd character-naming-backend\n```\n\n3. Install dependencies\n\n```bash\n  npm install\n```\n\n4. Start the server\n\n```bash                           \n  npm run start\n```\n## Configuration\n\nBefore running the application, configure the following:\n\n- Database connection settings in `config/database.json`.\n- Environment variables such as JWT_SECRET and database credentials.\n\n## Usage\n\n### API Endpoints\n\nThe backend provides the following API endpoints:\n## API Reference\n\n### Character Images\n\n#### Get All Character Images\n\n- **URL**: `/api/characters`\n- **Method**: `GET`\n- **Description**: Get all character images.\n\n#### Get Character Image by ID\n\n- **URL**: `/api/characters/{characterId}`\n- **Method**: `GET`\n- **Description**: Get a character image by ID.\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `characterId` | `integer` | **Required** - The character photo ID. |\n\n#### Post Character Name\n\n- **URL**: `/api/characters/{characterId}/name`\n- **Method**: `POST`\n- **Description**: Posts a name to a character photo if authorized.\n- **Security**: Bearer Token Authentication\n\n  | Request Body | Type       | Description                   |\n  | :------------ | :--------- | :---------------------------- |\n  | `description` | `string` | **Required** - Required data for creating name. |\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `characterId` | `integer` | **Required** - The character photo ID. |\n\n#### Update Character Name\n\n- **URL**: `/api/name/{nameId}`\n- **Method**: `PUT`\n- **Description**: Updates a name when a user is authorized.\n- **Security**: Bearer Token Authentication\n\n  | Request Body | Type       | Description                   |\n  | :------------ | :--------- | :---------------------------- |\n  | `description` | `string` | **Required** - Required data for updated name. |\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `nameId`    | `integer` | **Required** - The name ID.  |\n\n#### Delete Character Name\n\n- **URL**: `/api/name/{nameId}`\n- **Method**: `DELETE`\n- **Description**: Deletes a name when a user is authorized.\n- **Security**: Bearer Token Authentication\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `nameId`    | `integer`  | **Required** - The name ID.  |\n\n### User Authentication\n\n#### User Registration\n\n- **URL**: `/api/auth/signup`\n- **Method**: `POST`\n- **Description**: Creates a new user.\n\n  | Request Body | Type       | Description                   |\n  | :------------ | :--------- | :---------------------------- |\n  | `email` | `string` | **Required** - Email address for registration. |\n  | `password` | `string` | **Required** - Password for registration. |\n  | `username` | `string` | **Required** - Username for registration. |\n\n#### User Login\n\n- **URL**: `/api/auth/login`\n- **Method**: `POST`\n- **Description**: Logs in a user.\n\n  | Request Body | Type       | Description                   |\n  | :------------ | :--------- | :---------------------------- |\n  | `email` | `string` | **Required** - Email address for login. |\n  | `password` | `string` | **Required** - Password for login. |\n\n#### User Logout\n\n- **URL**: `/api/auth/logout`\n- **Method**: `POST`\n- **Description**: Logs out a user.\n\n#### Update User Profile\n\n- **URL**: `/api/auth/user`\n- **Method**: `PUT`\n- **Description**: Update a user's profile.\n- **Security**: Bearer Token Authentication\n\n  | Request Body | Type       | Description                   |\n  | :------------ | :--------- | :---------------------------- |\n  | `email` | `string` | Email address for update (optional). |\n  | `password` | `string` | Password for update (optional). |\n  | `username` | `string` | Username for update (optional). |\n\n### Voting\n\n#### Cast a Vote\n\n- **URL**: `/api/vote/name/{nameId}`\n- **Method**: `POST`\n- **Description**: Cast a vote for a name.\n- **Security**: Bearer Token Authentication\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `nameId`    | `integer`  | **Required** - The ID of the name to vote for. |\n\n#### Remove a Vote\n\n- **URL**: `/api/vote/{voteId}`\n- **Method**: `DELETE`\n- **Description**: Remove a vote.\n- **Security**: Bearer Token Authentication\n\n  | Parameter   | Type       | Description                   |\n  | :---------- | :--------- | :---------------------------- |\n  | `voteId`    | `integer`  | **Required** - The ID of the vote to remove. |\n\n### Authentication\n\nThe backend uses JWT (JSON Web Tokens) for authentication. Users can sign up, log in, and perform authenticated actions such as updating their profile and casting votes.\n\n### Database\n\nThe project uses PostgreSQL as the database. You can find the database schema in the Sequelize model files located in the `models` directory. Use Sequelize CLI for database migrations and seeding data.\n\n### Documentation\n\nExplore the API documentation using Swagger UI. Access it at `/api/docs` after starting the server\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydnmeyburgh%2Fcharacter-naming-contest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaydnmeyburgh%2Fcharacter-naming-contest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydnmeyburgh%2Fcharacter-naming-contest/lists"}